const app=getApp();
Page({

  data: {
    myCommentList: []
  },

  onLoad: function () {
    const openid=app.globalData.openid;
    console.log(openid);
    var that=this;
    wx.request({
      url: `${app.globalData.baseurl}goods/myComment`,
      method: "POST",
      data: {
        openid: app.globalData.openid,
      },
      success: function (res) {
        console.log(res.data);
        that.setData({
          myCommentList:res.data
        })
        if(that.data.myCommentList.length==0){
          that.setData({
            toast:'暂无评价'
          })
        }
        console.log(that.data.myCommentList)
      },
    })
  },
  toGoodDetail(event){
    console.log(event.currentTarget.dataset.id);
    let id=event.currentTarget.dataset.id;
    wx.navigateTo({
      // url: '../goodDetail/goodDetail?goodsId='+id,
      url:'../goodDetail/goodDetail?goodsId='+id,
    })
  }
})